<?php

/*
* 获取表情包 
* 可直接用于 微信小程序
*
* url: http://www.oicqzone.com/tool/emoji/  资源地址
*
*/
function getWxAppEmoji(){
    $a=file_get_contents("http://www.oicqzone.com/tool/emoji/");
    $html=preg_replace("/[\t\n\r]+/","",$a);
    $pattern='/<td(.*?)>(.*?)<\/td>/s';
    preg_match_all($pattern,$html,$res);

    $arr=[];
    foreach ($res[0] as $key => $value) {
        $value=preg_replace("/[<td.*>]+/","",$value);
        if(!empty($value) && !preg_match("/[a-zA-Z]+/",$value) && !preg_match("/\-/",$value)){
            array_push($arr,preg_replace('/\//','',$value));
        }        
    }

    return $arr;
}


//var_dump(getWxAppEmoji());
